<template>
  <ContentWrap
    class="mb-0!"
    :class="[
      footer
        ? '!h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height)-10px)]'
        : '!h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-20px)]'
    ]"
    :bodyStyle="{ height: '100%', padding: '10px' }"
  >
    <div class="flex flex-col !h-full justify-between">
      <el-scrollbar viewClass="flex-grow ">
        <el-row>
          <el-col :span="24">
            <div class="custom-text-18 mb-10px"> 销售人 </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
          <el-popover
            placement="top-start"
            title="销售人"
            :width="200"
            trigger="hover"
            :content="cartEmployeeText"
          >
            <template #reference>
              <div class="custom-text-16">
                <el-text line-clamp="1"> {{ cartEmployeeText }} </el-text>
              </div>
            </template>
          </el-popover>

          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="custom-text-18"> 充值明细 </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row v-if="orderInfo.rechargeMoeny > 0">
          <el-col :span="24">
            <div class="flex justify-between custom-text-16">
              <div> 充值金额 </div>
              <div> ￥{{ orderInfo.rechargeMoeny }} </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row v-if="orderInfo.giveMoney > 0">
          <el-col :span="24">
            <div class="flex justify-between custom-text-16">
              <div> 赠送金额 </div>
              <div> ￥{{ orderInfo.giveMoney }} </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row v-if="orderInfo.giveIntergral > 0">
          <el-col :span="24">
            <div class="flex justify-between custom-text-16">
              <div> 赠送积分 </div>
              <div> {{ orderInfo.giveIntergral }} </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row v-if="orderInfo.giveGrow > 0">
          <el-col :span="24">
            <div class="flex justify-between custom-text-16">
              <div> 赠送经验值 </div>
              <div> {{ orderInfo.giveGrow }} </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="custom-text-18"> 结算 </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row v-if="orderInfo.rechargeMoeny > 0">
          <el-col :span="24">
            <div class="flex justify-between custom-text-16">
              <div> 订单金额 </div>
              <div> ￥{{ orderInfo.rechargeMoeny }} </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row class="pos-sticky bottom-0" v-if="orderInfo.rechargeMoeny > 0">
          <el-col :span="24">
            <div class="flex justify-between custom-text-16">
              <div> 待支付金额 </div>
              <div class="c-[var(--el-color-primary)] custom-text-18">
                <span>￥</span>{{ orderInfo.rechargeMoeny }}
              </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
      </el-scrollbar>
      <div class="flex justify-end">
        <slot name="button"></slot>
      </div>
    </div>
  </ContentWrap>
</template>
<script setup lang="ts" name="orderInfo">
/** 购物车信息 */
import { propTypes } from '@/utils/propTypes'
import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
const footer = computed(() => appStore.getFooter)
/**
 *
 * @param paymentlist 支付列表
 * @param type  0 支付 1 优惠
 */

defineProps({
  cartEmployeeText: propTypes.string.def(''),
  orderInfo: propTypes.object
})
</script>
